using System.ComponentModel;
using System.Configuration;

namespace Needle.Core.Configuration {
    /// <summary>
    /// Describes an injected method.
    /// </summary>
    [Description("Describes an injected method.")]
    public class MethodElement : ConfigurationElement {

        /// <summary>
        /// The name of the method.
        /// </summary>
        [ConfigurationProperty(Element.Name, IsRequired = true)]
        [Description("The name of the method.")]
        public string Name
        {
            get { return (string)this[Element.Name]; }
            set { this[Element.Name] = value; }
        }
        /// <summary>
        /// The injected arguments.
        /// </summary>
        [ConfigurationCollection(typeof(ArgumentElement))]
        [ConfigurationProperty(Element.Args, IsDefaultCollection = true, IsRequired = false)]
        [Description("The injected arguments.")]
        public ArgumentElementCollection Args
        {
            get { return (ArgumentElementCollection)this[Element.Args]; }
        }

        /// <summary>
        /// The order of injection.
        /// </summary>
        [ConfigurationProperty(Element.Order, IsRequired = false)]
        [Description("The order of injection.")]
        public int Order
        {
            get { return (int)this[Element.Order]; }
            set { this[Element.Order] = value; }
        }

    }

}
